//
//  HGMusicOneCollectionViewCell.m
//  悦享
//
//  Created by dllo on 16/3/21.
//  Copyright © 2016年 张洪国. All rights reserved.
//

#import "HGMusicOneCollectionViewCell.h"
#import <UIImageView+WebCache.h>
@implementation HGMusicOneCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.image1 = [[UIImageView alloc] init];
        [self.contentView addSubview:_image1];
        
        
        self.label1 = [[UILabel alloc] init];
        [self.contentView addSubview:_label1];
        
    }
    return self;
}

- (void)setModel:(HGMusicDataModel *)model{
    _model = model;
    
    [_image1 sd_setImageWithURL:[NSURL URLWithString:_model.picUrl] placeholderImage:[UIImage imageNamed:PLACE_HLODER]];
    _label1.text = _model.name;
    
    
}


- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    _image1.frame = CGRectMake((layoutAttributes.frame.size.width -40)/2, 0, 30, 30);
    
    _label1.frame = CGRectMake((layoutAttributes.frame.size.width -40)/2-13,32, 50, 20);
    _label1.font = [UIFont systemFontOfSize:13];
    _label1.textColor = [UIColor blueColor];
    _label1.textAlignment = NSTextAlignmentCenter;
}

@end
